﻿// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
//
// 本项目主要遵循 MIT 许可证和 Apache 许可证（版本 2.0）进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
//
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动！任何基于本项目二次开发而产生的一切法律纠纷和责任，我们不承担任何责任！

using Admin.NET.Core;
using Magicodes.ExporterAndImporter.Core;
using System.ComponentModel.DataAnnotations;

namespace Admin.NET.Application;

/// <summary>
/// 收款记录基础输入参数
/// </summary>
public class CollectionBaseInput
{
    /// <summary>
    /// 主键Id
    /// </summary>
    public virtual long? Id { get; set; }
    
    /// <summary>
    /// 收款单号
    /// </summary>
    public virtual string? CollectionNum { get; set; }
    
    /// <summary>
    /// 收款金额
    /// </summary>
    public virtual decimal? CollectionMoney { get; set; }
    
    /// <summary>
    /// 收款时间
    /// </summary>
    public virtual DateTime? CollectionTime { get; set; }
    
    /// <summary>
    /// 收款方式
    /// </summary>
    [Dict("Type-of-collection-record", AllowNullValue=true)]
    public virtual string? CollectionType { get; set; }
    
}

/// <summary>
/// 收款记录分页查询输入参数
/// </summary>
public class PageCollectionInput : BasePageInput
{
    /// <summary>
    /// 收款单号
    /// </summary>
    public string? CollectionNum { get; set; }
    
    /// <summary>
    /// 收款金额
    /// </summary>
    public decimal? CollectionMoney { get; set; }
    
    /// <summary>
    /// 收款时间范围
    /// </summary>
     public DateTime?[] CollectionTimeRange { get; set; }
    
    /// <summary>
    /// 收款方式
    /// </summary>
    [Dict("Type-of-collection-record", AllowNullValue=true)]
    public string? CollectionType { get; set; }
    
    /// <summary>
    /// 选中主键列表
    /// </summary>
     public List<long> SelectKeyList { get; set; }
}

/// <summary>
/// 收款记录增加输入参数
/// </summary>
public class AddCollectionInput
{
    /// <summary>
    /// 收款单号
    /// </summary>
    [MaxLength(32, ErrorMessage = "收款单号字符长度不能超过32")]
    public string? CollectionNum { get; set; }
    
    /// <summary>
    /// 收款金额
    /// </summary>
    public decimal? CollectionMoney { get; set; }
    
    /// <summary>
    /// 收款时间
    /// </summary>
    public DateTime? CollectionTime { get; set; }
    
    /// <summary>
    /// 收款方式
    /// </summary>
    [Dict("Type-of-collection-record", AllowNullValue=true)]
    [MaxLength(32, ErrorMessage = "收款方式字符长度不能超过32")]
    public string? CollectionType { get; set; }
    
}

/// <summary>
/// 收款记录删除输入参数
/// </summary>
public class DeleteCollectionInput
{
    /// <summary>
    /// 主键Id
    /// </summary>
    [Required(ErrorMessage = "主键Id不能为空")]
    public long? Id { get; set; }
    
}

/// <summary>
/// 收款记录更新输入参数
/// </summary>
public class UpdateCollectionInput
{
    /// <summary>
    /// 主键Id
    /// </summary>    
    [Required(ErrorMessage = "主键Id不能为空")]
    public long? Id { get; set; }
    
    /// <summary>
    /// 收款单号
    /// </summary>    
    [MaxLength(32, ErrorMessage = "收款单号字符长度不能超过32")]
    public string? CollectionNum { get; set; }
    
    /// <summary>
    /// 收款金额
    /// </summary>    
    public decimal? CollectionMoney { get; set; }
    
    /// <summary>
    /// 收款时间
    /// </summary>    
    public DateTime? CollectionTime { get; set; }
    
    /// <summary>
    /// 收款方式
    /// </summary>    
    [Dict("Type-of-collection-record", AllowNullValue=true)]
    [MaxLength(32, ErrorMessage = "收款方式字符长度不能超过32")]
    public string? CollectionType { get; set; }
    
}

/// <summary>
/// 收款记录主键查询输入参数
/// </summary>
public class QueryByIdCollectionInput : DeleteCollectionInput
{
}

/// <summary>
/// 收款记录数据导入实体
/// </summary>
[ExcelImporter(SheetIndex = 1, IsOnlyErrorRows = true)]
public class ImportCollectionInput : BaseImportInput
{
    /// <summary>
    /// 收款单号
    /// </summary>
    [ImporterHeader(Name = "收款单号")]
    [ExporterHeader("收款单号", Format = "", Width = 25, IsBold = true)]
    public string? CollectionNum { get; set; }
    
    /// <summary>
    /// 收款金额
    /// </summary>
    [ImporterHeader(Name = "收款金额")]
    [ExporterHeader("收款金额", Format = "", Width = 25, IsBold = true)]
    public decimal? CollectionMoney { get; set; }
    
    /// <summary>
    /// 收款时间
    /// </summary>
    [ImporterHeader(Name = "收款时间")]
    [ExporterHeader("收款时间", Format = "", Width = 25, IsBold = true)]
    public DateTime? CollectionTime { get; set; }
    
    /// <summary>
    /// 收款方式 关联值
    /// </summary>
    [ImporterHeader(IsIgnore = true)]
    [ExporterHeader(IsIgnore = true)]
    public string? CollectionType { get; set; }
    
    /// <summary>
    /// 收款方式 文本
    /// </summary>
    [Dict("Type-of-collection-record")]
    [ImporterHeader(Name = "收款方式")]
    [ExporterHeader("收款方式", Format = "", Width = 25, IsBold = true)]
    public string CollectionTypeDictLabel { get; set; }
    
}
